package title;

/**
 * @author 111
 * @version 1.0
 * @date 2025/4/14 19:57
 * @description
 */
public class Test04 {
    public static void main(String[] args) {
        double num = Math.random() * 100;
        System.out.println("随机数为：" +num);
        String str = num + "";
        str = str.substring(0,str.indexOf(".") + 3);
        System.out.println("截取小数点后两位后为：" + str);
    }
}
